﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using DataAnnotationsExtensions;


namespace Hetang.Models.DataContext
{
    [MetadataType(typeof(MemberMetaData))]
    public partial class tbl_Company
    {
        private class MemberMetaData
        {
            public int Id { get; set; }

            [DisplayName("公司名称")]
            [Required]
            [StringLength(16, MinimumLength = 4, ErrorMessage = "公司名称4-16个字符")]
            public string Name { get; set; }

            [DisplayName("公司简介")]
            [Required]
            public string Introduce { get; set; }

            [DisplayName("公司LOGO")]
            public string Logo { get; set; }

            [DisplayName("部门")]
            public string Department { get; set; }

            [DisplayName("所属行业")]
            public string Trade { get; set; }

            [DisplayName("单位性质")]
            [Required]
            public string Unit_character { get; set; }

            [DisplayName("注册资金")]
            public string Registered_Capital { get; set; }

            [DisplayName("员工人数")]
            public string Employees { get; set; }

            [DisplayName("成立时间")]
            [Required]
            [Date(ErrorMessage="日期格式或输入不正确。")]
            public string Founding_Time { get; set; }

            [DisplayName("联系人")]
            [Required]
            [StringLength(10, ErrorMessage = "最多10个字符。")]
            public string Contacts { get; set; }

            [DisplayName("联系QQ")]
            public string QQ { get; set; }

            [DisplayName("联系电话")]
            [Required]
            public string Phone { get; set; }

            [DisplayName("传真")]
            public string Fax { get; set; }

            [DisplayName("电子邮箱")]
            [Email(ErrorMessage = "电子邮箱格式不正确。")]
            public string Email { get; set; }

            [DisplayName("联系地址")]
            [Required]
            public string Address { get; set; }

            [DisplayName("公司网站")]
            public string Website { get; set; }

            [DisplayName("招聘信息")]
            public string Recruit { get; set; }

            [DisplayName("添加时间")]
            public System.DateTime AddDate { get; set; }
        }
    }

    [MetadataType(typeof(MemberMetaData))]
    public partial class tbl_Job
    {
        private class MemberMetaData
        {            
            [DisplayName("ID")]
            public int Id { get; set; }

            [DisplayName("公司ID")]
            public int CompanyId { get; set; }

            [DisplayName("职位名称")]
            [Required]
            public string JobName { get; set; }

            [DisplayName("招聘人数")]
            [Required]
            [Min(1,ErrorMessage="不打算招人吗？")]
            public string Many { get; set; }

            [DisplayName("招聘部门")]
            public string Department { get; set; }

            [DisplayName("更新日期")]
            public DateTime UpdateDate { get; set; }

            [DisplayName("有效期")]
            public DateTime ValidDate { get; set; }

            [DisplayName("职位类型")]
            public string PostitonType { get; set; }

            [DisplayName("英语水平")]
            [Required]
            public string English { get; set; }

            [DisplayName("月薪")]
            public string Salary { get; set; }

            [DisplayName("工作地点")]
            public string WorkPlace { get; set; }

            [DisplayName("联系人")]
            [Required]
            [StringLength(10, ErrorMessage = "最多10个字符。")]
            public string Contacts { get; set; }

            [DisplayName("联系电话")]
            [Required]
            [StringLength(13, ErrorMessage = "电话号码有这么长吗？")]
            public string Phone { get; set; }

            [DisplayName("传真")]
            [StringLength(13, ErrorMessage = "传真号码有这么长吗？")]
            public string Fax { get; set; }

            [DisplayName("QQ")]
            [StringLength(11, ErrorMessage = "现在没有这么长的QQ号码吧？")]
            public string QQ { get; set; }

            [DisplayName("学历要求")]
            [StringLength(2, ErrorMessage = "修改代码是没有用的。")]
            public string Learn { get; set; }

            [DisplayName("年龄")]
            [Required]
            [Range(18, 65, ErrorMessage = "18-65岁之间吧。")]
            public string Age { get; set; }    

            [DisplayName("性别")]
            public string Sex { get; set; }

            [DisplayName("工作经验")]
            public string Experiences { get; set; }

            [DisplayName("联系地址")]
            [Required]
            public string Address { get; set; }

            [DisplayName("其它要求")]
            [Required]
            public string OtherDemand { get; set; }

            [DisplayName("添加时间")]
            public DateTime AddDate { get; set; }

            [DisplayName("紧急招聘")]
            public bool Urgent { get; set; }
        }
    }

    [MetadataType(typeof(MemberMetaData))]
    public partial class tbl_Resume
    {
        private class MemberMetaData
        {
            public int Id { get; set; }
            
            public int UserId { get; set; }
            
            [DisplayName("电子邮箱")]               
            public string Email { get; set; }

            [Required]
            [DisplayName("真实姓名")]
            [RegularExpression("^[a-zA-Z\u4e00-\u9fa5 ]{2,10}$", ErrorMessage = "中英文2-10个字符")]
            public string Name { get; set; }

            [Required]
            [DisplayName("性别")]
            public string Sex { get; set; }
            
            [DisplayName("户籍")]
            public string Domicile { get; set; }

            [Required]
            [DisplayName("出生年份")]
            public DateTime Born { get; set; }

            public string Photo { get; set; }

            [Required]
            [DisplayName("毕业学校")]
            [StringLength(20,ErrorMessage="最多可以20个字符！")]
            public string School { get; set; }

            [Required]
            [DisplayName("所学专业")]
            public string Profession { get; set; }

            [Required]
            [DisplayName("学历")]
            public string Learn { get; set; }

            [Required]
            [DisplayName("计算机水平")]
            public string Computer { get; set; }

            [DisplayName("英语水平")]
            public string English { get; set; }

            public DateTime Add_Date { get; set; }

            public DateTime Modify_Date { get; set; }

            [Required]            
            [DisplayName("求职信")]
            [DataType(System.ComponentModel.DataAnnotations.DataType.MultilineText)]
            public string Letter { get; set; }

            [Required]
            [DisplayName("联系电话")]
            [RegularExpression("[0-9]{3}-[0-9]{8}|[0-9]{4}-[0-9]{7,8}|[0-9]{11}", ErrorMessage = "格式：0750-3712345 或 13812345678")]
            public string Phone { get; set; }

            [DisplayName("QQ")]
            [RegularExpression("^[0-9]{5,11}$",ErrorMessage="5-11位数字！")]
            public string QQ { get; set; }

            [DisplayName("个人网站")]
            public string WebSite { get; set; }

            [Required]
            [StringLength(50,MinimumLength=8,ErrorMessage="地址详细一点吧？")]
            [DisplayName("联系地址")]
            public string Address { get; set; }
        }
    }
}